Holds all information required for an image, with ownership over the data. More...
Public Member Functions | |
Image () | |
Image (nkMemory::Buffer &&data) | |
Image (nkMemory::Buffer &&data, unsigned int width, unsigned int height, unsigned int depth, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize=0, unsigned int rowByteSize=0, unsigned int sliceByteSize=0) | |
Image (nkMemory::Buffer &&data, unsigned int width, unsigned int height, unsigned int depth, unsigned int arraySize, unsigned int mips, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize=0) | |
Image (nkMemory::Buffer &&data, nkMemory::BufferCast< ImageDescriptor > &&images, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize, bool alphaPremultiplied=false, bool cubeMap=false) | |
Image (const Image &other) | |
Image (Image &&other) | |
Image (const ImageView &view) | |
~Image () | |
virtual unsigned char * | getDataPtr () const override |
virtual unsigned long long | getDataByteSize () const override |
virtual nkMemory::BufferView | getDataBuffer () const override |
const nkMemory::Buffer & | getData () const |
Image & | operator= (const Image &other) |
Image & | operator= (Image &&other) |
![]() | |
ImageBase () | |
ImageBase (unsigned int width, unsigned int height, unsigned int depth, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize=0, unsigned int rowByteSize=0, unsigned int sliceByteSize=0) | |
ImageBase (unsigned int width, unsigned int height, unsigned int depth, unsigned int arraySize, unsigned int mips, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize=0) | |
ImageBase (nkMemory::BufferCast< ImageDescriptor > &&images, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize, bool alphaPremultiplied=false, bool cubeMap=false) | |
ImageBase (const ImageBase &other) | |
ImageBase (ImageBase &&other) | |
virtual | ~ImageBase () |
unsigned int | getWidth (unsigned int mip=0) const |
unsigned int | getHeight (unsigned int mip=0) const |
unsigned int | getDepthOrArraySize (unsigned int mip=0) const |
unsigned int | getMipCount () const |
PIXEL_FORMAT | getFormat () const |
unsigned int | getPixelByteSize () const |
unsigned int | getRowByteSize (unsigned int mip=0) const |
unsigned int | getSliceByteSize (unsigned int mip=0) const |
bool | getAlphaPremultiplied () const |
bool | getCubeMap () const |
bool | isArray () const |
void | setFormat (PIXEL_FORMAT value) |
void | setPixelOrBlockByteSize (unsigned int value) |
void | setAlphaPremultiplied (bool value) |
void | setCubeMap (bool value) |
nkMaths::Vector | getPixel (unsigned int x, unsigned int y, unsigned int z=0, unsigned int mip=0) |
Image | decompress (const AlignmentDescriptor &alignmentDescriptor=AlignmentDescriptor()) |
ImageBase & | operator= (const ImageBase &other) |
ImageBase & | operator= (ImageBase &&other) |
Holds all information required for an image, with ownership over the data.
See ImageBase for more information.
nkImages::Image::Image | ( | ) |
Default constructor.
nkImages::Image::Image | ( | nkMemory::Buffer && | data | ) |
Data-move constructor.
data | The buffer which data should be part of the image. |
nkImages::Image::Image | ( | nkMemory::Buffer && | data, |
unsigned int | width, | ||
unsigned int | height, | ||
unsigned int | depth, | ||
PIXEL_FORMAT | format, | ||
unsigned int | pixelOrBlockByteSize = 0 , |
||
unsigned int | rowByteSize = 0 , |
||
unsigned int | sliceByteSize = 0 |
||
) |
2D image without mips constructor.
data | The buffer which data should be part of the image. |
width | The width of the image, in pixels. |
height | The height of the image, in pixels. |
depth | The depth of the image, in number of slices of width * height images. |
format | The format of the image. |
pixelOrBlockByteSize | The size of a pixel or block, in bytes. Defaults to 0 to be automatically derived from the format. |
rowByteSize | The size of a row, in bytes. Defaults to 0 to be automatically derived from the pixel byte size and width. |
sliceByteSize | The size of a slice, in bytes. Defaults to 0 to be automatically derived from the row size size and height. |
nkImages::Image::Image | ( | nkMemory::Buffer && | data, |
unsigned int | width, | ||
unsigned int | height, | ||
unsigned int | depth, | ||
unsigned int | arraySize, | ||
unsigned int | mips, | ||
PIXEL_FORMAT | format, | ||
unsigned int | pixelOrBlockByteSize = 0 |
||
) |
Tightly packed full constructor. Will derive all information for slices and mips based on width, height, depth and format given / pixelOrBlockSize given. Memory will be assumed as being tightly packed (no padding inside).
data | The buffer which data should be part of the image. |
width | The width of the image, in pixels. |
height | The height of the image, in pixels. |
depth | The depth of the image, in number of slices of width * height images. |
arraySize | The number of slice in the image array. |
mips | The number of mips for each image slice. |
format | The pixel format of the image. |
pixelOrBlockByteSize | The size of a pixel or block, in bytes. Defaults to 0 to be automatically derived from the format. |
nkImages::Image::Image | ( | nkMemory::Buffer && | data, |
nkMemory::BufferCast< ImageDescriptor > && | images, | ||
PIXEL_FORMAT | format, | ||
unsigned int | pixelOrBlockByteSize, | ||
bool | alphaPremultiplied = false , |
||
bool | cubeMap = false |
||
) |
Full constructor.
data | The buffer which data should be part of the image. |
images | The sub-images constituting the full image. One entry corresponds to an entry within a 2D image array. |
format | The pixel format of the image. |
pixelOrBlockByteSize | The size of a pixel or block, in bytes. |
alphaPremultiplied | Whether the alpha is premultiplied (true) or not (false). |
cubeMap | Whether the image is a cube map (true) or not (false). |
nkImages::Image::Image | ( | const Image & | other | ) |
Copy constructor. Will make a copy of the data.
other | The image to copy from. |
nkImages::Image::Image | ( | Image && | other | ) |
Move constructor. Will move the data over.
other | The image to move. |
nkImages::Image::Image | ( | const ImageView & | view | ) |
Copy constructor, from a view. Will make a copy of the data.
view | The view to copy from. |
nkImages::Image::~Image | ( | ) |
Destructor.
|
overridevirtual |
Implements nkImages::ImageBase.
|
overridevirtual |
Implements nkImages::ImageBase.
|
overridevirtual |
Implements nkImages::ImageBase.
const nkMemory::Buffer& nkImages::Image::getData | ( | ) | const |
Copy assignment operator.
other | The image to copy and assign. |
Move assignment operator.
other | The image to move and assign. |